package com.local.thread;

import java.util.List;

/**
 * @author relieved-gao
 * @version 1.0 , 2017/11/9
 * @since 1.0
 */
public class TestTask implements Runnable {
	private List<String> listStr;

	public TestTask() {
	}

	public TestTask(List<String> test) {
		this.listStr = test;
	}

	final ArrayUtil arrayUtil = new ArrayUtil();

	public void run() {
		while (true) {
			if (listStr != null && listStr.size() != 0) {
				//System.out.println(Thread.currentThread().getName()+"：\t不为空");
				arrayUtil.traversalArray(new String[] { "1", "2" });
			} else {
				//System.out.println(Thread.currentThread().getName()+"：\t为空");
				arrayUtil.traversalArray(new String[] { "a", "b" });
			}
		}
	}

	class ArrayUtil {
		public void traversalArray(String[] param) {
			//System.out.print(Thread.currentThread().getName() + ":");
			for (int i = 0; i < param.length; i++) {
				System.out.print(param[i]);
			}
			System.out.println();
		}
	}
}
